package com.tricode.ile.training.task.one.getminimumfromarray;

import java.util.Scanner;

import com.tricode.ile.training.task.one.helpers.PrintArray;

public class MainGetMinimum {

	public static void main(String[] args) {
		
		GetMinimumElementFromArray min = new GetMinimumElementFromArray();
		
		Scanner scanner = new Scanner(System.in);
		int[] array = new int[5000];
		int i = 0;
		System.out.println("Enter the elements:");
		while (scanner.hasNextInt()) {
			array[i] = scanner.nextInt();
			i++;
		}
		scanner.close();
		int[] newArray = new int[i];
		System.arraycopy(array, 0, newArray, 0, i);
		
		PrintArray printArray = new PrintArray();
		System.out.println("This is the array you entered:");
		printArray.printArrayOfIntegers(newArray);
		
		int result = min.getMinimum(newArray);
		System.out.println("The minimum element from the array you entered is: "+result);
	}

}
